package com.zzg.srb.core.controller.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzg.srb.common.result.R;
import com.zzg.srb.core.entity.pojo.UserInfo;
import com.zzg.srb.core.entity.query.UserInfoQuery;
import com.zzg.srb.core.service.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author zhengzg
 * @Date 2022/6/13 13:33
 * @Version 1.0
 */

@RestController
@RequestMapping("/admin/core/userInfo")
@Api(tags = "积分等级表")
public class AdminUserInfoController {

    @Resource
    private UserInfoService userInfoService;

    @ApiOperation("获取会员分页列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "页数",value = "page",dataType = "Long",required = false),
            @ApiImplicitParam(name = "条数",value = "limit",dataType = "Long",required = false),
            @ApiImplicitParam(name = "查询条件",value = "userInfoQuery",dataType = "UserInfoQuery",required = false)
    })
    @GetMapping("/list/{page}/{limit}")
    public R listPage(@PathVariable Long page, @PathVariable Long limit,@RequestBody(required = false) UserInfoQuery userInfoQuery){
       return R.ok().data(userInfoService.listPage(new Page<UserInfo>(page,limit),userInfoQuery));
    }
}
